
$(function() {
	var url = 'http://ittalentsapi.bashibozuk.eu/game?X-GameID=102&expand=user&page=1&per-page=5&sortField=score&sortDirection=DESC';;
	  
	$.ajax(url, {
		method: 'GET',
		crossDomain: true,
		dataType: 'json',
		
		success: function(data) {
                        var n = parseInt(arguments[2].getAllResponseHeaders()[131]+arguments[2].getAllResponseHeaders()[132]);
			var string = '';
			for(var i=1;i<=5;i++) {
				
				string+='<div class="playerRow"><span class="playerNum">'+i+'</span><span class="playerName">'+data[i-1].user.username+'</span><span class="playerScore">'+data[i-1].score+'</span></div>';
			}
			$('#bestFive').html(string);
			
			
		}
	});
	
        
});


